package in.iqing.control.util;

import android.text.TextUtils;

import com.spreada.utils.chinese.ZHConverter;

/**
 * Created by neavo on 14-3-15.
 */

public class ConvertUtil {

	public static synchronized String toSimplified(String text) {
		if (TextUtils.isEmpty(text)) {
			return "";
		} else {
			return ZHConverter.convert(text, ZHConverter.SIMPLIFIED);
		}
	}

	public static synchronized String toTraditional(String text) {
		if (TextUtils.isEmpty(text)) {
			return "";
		} else {
			return ZHConverter.convert(text, ZHConverter.TRADITIONAL);
		}
	}

	public static synchronized String convert(String text, boolean v) {
		if (TextUtils.isEmpty(text)) {
			return "";
		} else if (v) {
			return ZHConverter.convert(text, ZHConverter.TRADITIONAL);
		} else {
			return ZHConverter.convert(text, ZHConverter.SIMPLIFIED);
		}
	}
}
